package org.example.jwt.vo;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Result {

    private Integer code;
    private String msg;
    private Object data;
    private boolean success;

    private Result(){}

    public static Result ok(){
        Result result = new Result();
        result.setCode(0);
        result.setMsg("success");
        result.setSuccess(true);
        return result;
    }

    public static Result error(){
        Result result = new Result();
        result.setCode(5000);
        result.setMsg("error");
        result.setSuccess(false);
        return result;
    }
}
